package com.hongxin.nw.netty.utils.pools;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * 记录客户端请求的接口情况
 */
public class ClientPools {

    //记录客户端请求的接口情况
    private final static Map<String, Long> clientList = new ConcurrentHashMap<>();
    public static int getSize(){
        return clientList.size();
    }
    public static long getClient(final String str) {
        if (clientList.containsKey(str)){
            return clientList.get(str);
        }
        return 0L;
    }
    public static void addClient(final String str, final long time) {
        clientList.put(str, time);
    }
    public static void removeClient(final String str) {
        if (clientList.containsKey(str)){
            clientList.remove(str);
        }
    }
}